<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript">
	$(function() {
		var $grid = $('#set_duty');
		var $baseUrl = 'sys/duty';
		$grid.treegrid(
				{
					border : false,
					singleSelect : false,
					url : $baseUrl + '/treeGrid?sort=sort,asc',
					onAjaxSuccess : function(data) {
						$(this).treegrid('unselectAll').treegrid('selectUrl', {
							url : '${param.action}/selected?joinIds=${param.id}'
						});
					},
					onBeforeSelect : function(row) {
						if (!$.fields.type.isFunction(row)) {
							return false;
						}
					},
					columns : [ [ $.fields.permission.checkbox('dutyIds', false), $.fields.treeField, $.fields.codePath, $.fields.description, $.fields.type, $.fields.createTime,
							$.fields.lastModifyTime, $.fields.status ] ],
					toolbar : [ $.crudgrid.buttons.refresh, '-' ],
					filter : {
						prompt : '名称或代码',
						rules : [ {
							field : 'codePath',
							op : 'contains'
						}, {
							field : 'name',
							op : 'pinyinContains'
						} ]
					}
				}).treegrid('filter.init');
	});
</script>
<form action="${param.action}" method="post" class="easyui-panel" data-options="fit:true,border:false">
	<input name="id" value="${param.id}" type="hidden" />
	<table id="set_duty" style="width: 100%, height:100%;"></table>
	<input type="hidden" name="_dontcare" value="_dontcare"/>
</form>
